package common;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConectionHelpDB {
    private final static  String URL="jdbc:mysql://localhost:3306/demo";
    private final static  String USERNAME="root";
    private final static  String PWD="root";


    static {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static Connection getConnection(){
        try {
            return DriverManager.getConnection(URL,USERNAME,PWD);
        }catch ( SQLException e){
            e.printStackTrace();
        }
        return null;
    }
}
